home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / extlib20.arc / EXTLIB.H < prev    next >
Encoding:
C/C++ Source or Header  |  1990-03-09  |  4.9 KB  |  175 lines

  1. /****************************************************************************
  2. * extlib.h - Header file for EXTLIB 2.0
  3. *            Copyright (c) 1989 By Maine Data and Financial Systems, Inc.
  4. ****************************************************************************/
  5. #ifndef EXTLIB
  6. #define EXTLIB
  7.  
  8. #ifdef LATTICE
  9. #define max(a, b) (((a) > (b)) ? (a) : (b))
  10. #define nonibm _nonibm
  11. #define mouse_flag _mouse_flag
  12. #define mouse_row _mouse_row
  13. #define mouse_col _mouse_col
  14. #define left_button _left_button
  15. #define center_button _center_button
  16. #define right_button _right_button
  17. #define fillscreen _fillscreen
  18. #define hidemouse _hidemouse
  19. #define keypressed _keypressed
  20. #define movescreen _movescreen
  21. #define printstring _printstring
  22. #define readmouse _readmouse
  23. #define restorescreen _restorescreen
  24. #define resetmouse _resetmouse
  25. #define savescreen _savescreen
  26. #define setattrib _setattrib
  27. #define settext80 _settext80
  28. #define showmouse _showmouse
  29. #define waitkey _waitkey
  30. #define NULL 0L
  31. #endif
  32.  
  33. /* logic constants */
  34. #define TRUE 1
  35. #define FALSE 0
  36.  
  37. /* display type constants */
  38. #define IBM_CGA 0
  39. #define NONIBM_CGA 1
  40.  
  41. /* border line constants */
  42. #define DOUBLE_LINE 0
  43. #define SINGLE_LINE 1
  44. #define NO_BORDER 2
  45.  
  46. /* window constants */
  47. #define NO_CLEAR 0
  48. #define CLEAR 1
  49. #define NO_SCROLL 0
  50. #define SCROLL 1
  51. #define UP 0
  52. #define DOWN 1
  53. #define LEFT 2
  54. #define RIGHT 3
  55.  
  56. /* boolean data type */
  57. typedef int boolean;
  58.  
  59. /* structure declarations */
  60. typedef struct {
  61.     char *string;
  62.     int hotkey;
  63.     void (*function)(void);
  64.     void (*help)(void);
  65. } MENU;
  66.  
  67. typedef struct {
  68.     char *heading;
  69.     int hotkey, number;
  70.     MENU *mptr;
  71. } MENU_HEAD;
  72.  
  73. typedef struct {
  74.     int month, day, year;
  75. } DATE;
  76.  
  77. typedef struct {
  78.     int area, exchange, no;
  79. } PHONE ;
  80.  
  81. typedef struct {
  82.     int no1, no2, no3;
  83. } SSN ;
  84.  
  85. typedef struct {
  86.     int row1, col1, row2, col2, watt, bflg, sflg;
  87.     char *buffer;
  88.     int orow, ocol, ostart, oend;
  89.     int crow, ccol;
  90. } WINDOW ;
  91.  
  92. /* external variable declarations */
  93. extern int nonibm;
  94. extern int mouse_flag, mouse_row, mouse_col;
  95. extern int left_button, center_button, right_button;
  96. extern int menu_att, menu_hotkey, menu_highlight;
  97.  
  98. /* macro definitions */
  99. #define clearone(row, col, att)\
  100.         fillone(row, col, ' ', att)
  101. #define clearscreen(row1, col1, row2, col2, att)\
  102.         fillscreen(row1, col1, row2, col2, ' ', att)
  103. #define fillrow(row, col1, col2, chr, att)\
  104.         fillscreen(row, col1, row, col2, chr, att)
  105. #define fillcolumn(row1, col, row2, chr, att)\
  106.         fillscreen(row1, col, row2, col, chr, att)
  107. #define clearrow(row, col1, col2, att)\
  108.         fillrow(row, col1, col2, ' ', att)
  109. #define clearcolumn(row1, col, row2, att)\
  110.         fillcolumn(row1, col, row2, ' ', att)
  111.  
  112. /* function prototypes */
  113. void cursoroff(void);
  114. void cursoron(void);
  115. char *date_string(char *, DATE *);
  116. int dialog(int, int, int, MENU *, int, int, ...);
  117. void display_date(int, int, DATE *);
  118. void display_dollar(int, int, int, double *);
  119. void display_number(int, int, int, unsigned long *);
  120. void display_phone(int, int, PHONE *);
  121. void display_ssn(int, int, SSN *);
  122. void display_string(int, int, int, char *);
  123. void w_draw(int, int, int, int, int, int);
  124. void drawborder(int, int, int, int, int, int);
  125. void fillone(int, int, int, int);
  126. void far fillscreen(int, int, int, int, int, int);
  127. void far hidemouse(void);
  128. void getcurpos(int *, int *, int *, int *);
  129. void hotstring(int, int, int, char *);
  130. int input_date(int, int, DATE *);
  131. int input_dollar(int, int, int, double *);
  132. int input_number(int, int, int, unsigned long *);
  133. int input_phone(int, int, PHONE *);
  134. int input_ssn(int, int, SSN *);
  135. int input_string(int, int, int, char *);
  136. int far keypressed(void);
  137. void far movescreen(int, int, int, int, int, int);
  138. char *phone_string(char *, PHONE *);
  139. int popup(int, int, int, MENU *, int);
  140. void printcenter(int, int, char *);
  141. void printone(int, int, int);
  142. void far printstring(int, int, char far *);
  143. int pulldown(int, int, MENU_HEAD *, int, void(*)(void));
  144. void pulldown_bar(int, int, MENU_HEAD *);
  145. void far readmouse(void);
  146. void far resetmouse(void);
  147. void far restorescreen(int, int, int, int, char far *);
  148. void save_initial_video(void);
  149. void far savescreen(int, int, int, int, char far *);
  150. void far setattrib(int, int, int, int, int);
  151. void setone(int, int, int);
  152. void setcurpos(int, int);
  153. void setcursor(int, int);
  154. void far settext80(void);
  155. void far showmouse(void);
  156. char *ssn_string(char *, SSN *);
  157. int far waitkey(void);
  158. WINDOW *w_open(int, int, int, int, int, ...);
  159. WINDOW *w_close(WINDOW *);
  160. void w_setcurpos(WINDOW *, int, int);
  161. void w_cls(WINDOW *);
  162. void w_clreol(WINDOW *);
  163. void w_scroll(WINDOW *, int, int, boolean);
  164. void w_horizontal_bar(WINDOW *, int, int);
  165. void w_vertical_bar(WINDOW *, int, int);
  166. void w_print(WINDOW *, char *);
  167. void w_println(WINDOW *, char *);
  168. void w_printat(WINDOW *, int, int, char *);
  169. void w_printlnat(WINDOW *, int, int, char *);
  170. int w_printf(WINDOW *, int, int, char *, ... );
  171. int wprintf(int, int, char *, ... );
  172.  
  173. #endif
  174.  
  175.